<div class="modal-body">

    <form class="form-inline" id="goods_form_panel" onsubmit="return submitData(this)"  method="post">
        <input maxlength="5" value="{$model.username}"  style="width:200px; display: inline-block;" class="form-control" type="hidden" name="username" />
        <input maxlength="5" value="{$model.headpic}"  style="width:200px; display: inline-block;" class="form-control" type="hidden" name="headpic" />
        <if condition="$error" >
            <div class="alert alert-danger" role="alert">
                <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                <span class="sr-only">Error:</span>
                {$error}
            </div>
        </if>
        <table class="table table-striped table-bordered table-hover table-condensed">
            <tr>
                <th width="20%">用户名：</th>
                <td  colspan="2">
                    <img width="30" style="border-radius: 50%; border: 1px solid #666" src="//{$img_url}{$model.headpic}" />{$model.username}
                </td>
            </tr>

            <tr>
                <th width="12%" valign="middle">密码：</th>
                <td  colspan="2">
                    <input maxlength="30" value=""  style="width:200px; display: inline-block;" class="form-control" type="password" name="password" />
                </td>
            </tr>
            <tr>
                <th width="12%" valign="middle">重复密码：</th>
                <td  colspan="2">
                    <input maxlength="30" value=""  style="width:200px; display: inline-block;" class="form-control" type="password" name="repassword" />
                </td>
            </tr>
            <tr>
                <th width="20%">是否有效：</th>
                <td  colspan="2">
                    <select style="width: 200px;"  name="isvalid"  class="form-control">
                        <if condition="$model.isvalid eq '1'">
                            <option value="1" selected  >有效</option>
                            <option value="0">无效</option>
                        </if>
                        <if condition="$model.isvalid eq '0'">
                            <option value="1">有效</option>
                            <option value="0" selected>无效</option>
                        </if>
                    </select>
                </td>
            </tr>
        </table>
        <div class="layer_btn_panel">
            <input type="hidden" value="{$model.id}" name="id" />
            <button class="btn btn-sm btn-success" type="submit">确认保存</button>
            <input class="btn btn-sm" onclick="closeIframe()" type="button" value="取消" />
        </div>
    </form>
</div>


<script>
    var type="";
    function selectuser(t){
        type=t;
        var user_id=0;
        var to_user_id=0;
        if($("#user_id_panel").val()!=""){
            user_id=parseInt($("#user_id_panel").val());
        }
        var ids=user_id;
        showIframe("{:U('/user/select')}"+"?ids="+ids+"&type="+t,(t==0?"选择用户":"选择转入用户"),"500px","500px");
    }
    
    function handleUser (user) {
        if(type==0){
            $("#bill_user_panel").html('<button title="可转余额：'+user.balance+'" class="btn btn-primary" type="button">\n' +
                ''+user.username+' <span class="badge">'+user.balance+'</span>\n' +
                '</button>');
            $("#kezhuan_number").html("当前可转： "+user.balance);
            $("#user_id_panel").val(user.user_id)
        }else{
            $("#bill_touser_panel").html('<a title="可转余额：'+user.balance+'" href="javascript:void(0)" >\n' +
                ''+user.username+' <span class="badge">'+user.balance+'</span>\n' +
                '</a>');
            $("#to_user_id_panel").val(user.user_id)
        }
    }
    $(function () {
        $("#goods_type").change(function () {
            $("#goods_form_panel").submit();
        })
    })
</script>